package com.example.his.api.common;

import lombok.Data;

import java.util.List;

/**
 * @author huixh
 */
@Data
public class PageUtils {
    // 总记录数
    private long totalCount;
    // 页面显示几条
    private int pageSize;
    // 总页数
    private int totalPage;

    // 当前页数
    private int pageIndex;

    // 分页数据
    private List<?> list;

    public PageUtils(long totalCount, int pageSize, int pageIndex, List<?> list) {
        this.totalCount = totalCount;
        this.pageSize = pageSize;
        this.pageIndex = pageIndex;
        this.list = list;
        this.totalPage = (int) Math.ceil((double) totalCount / pageSize);
    }
}
